#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
int a[N];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  map<int, pii> mp;
  rep(i, 1, m) {
    int x, y;
    char c;
    cin >> x >> y >> c;
    if (!mp.count(x)) mp[x] = pii(0, n + 1);
    int l = mp[x].first, r = mp[x].second;
    if (c == 'B')
      l = max(l, y);
    else
      r = min(r, y);
    if (l >= r) {
      cout << "No";
      return 0;
    }
    mp[x] = pii(l, r);
  }
  int mx = 0;
  for (auto it = mp.rbegin(); it != mp.rend(); it++) {
    int l = it->second.first, r = it->second.second;
    mx = max(mx, l);
    if (mx >= r) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}